package xyz.showbooks.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;
import xyz.dfm.pojo.User;


import java.util.List;

/**
 * @author: Dsi
 * @date: 2022/2/12 14:24
 * @description:
 */
public interface UserMapper extends BaseMapper<User> {

    List<User> findUserImgById(@Param("query") String query, @Param("start") Integer start, @Param("size") Integer size);

    List<User> findUserByName(@Param("name") String name,@Param("start") Integer start,@Param("size") Integer size);

    @Transactional
    int updateStatus(@Param("userId") Integer userId, @Param("status") Integer status);

    List<User> findUserByNumber(@Param("query") String query,@Param("start") Integer start,@Param("size") Integer size);

    List<User> findUserByStatus(@Param("query") String query,@Param("start") Integer start,@Param("size") Integer size);

    Long IdTotal(String query);
    Long NameTotal(String query);
    Long NumberTotal(String query);
    Long StatusTotal(String query);

    User findUserById(Integer userId);

    User findUserByUP(User user);
}
